package com.mhc.suzuki.constant;

/**
 * 附件分组枚举类
 * Created by kanon on 2017/8/29.
 */
public enum AnnexGroupEnum {

    //购车人和共同购车人附件
    FAMILY(0, "family", "购车人和共同购车人附件"),
    BUYER(1, "buyer", "购车人附件"),
    COMMONBUYER(2, "buyer", "共同购车人附件"),
    SPONSOR(3, "sponsor", "担保人附件"),
    ASSETS(4, "assets", "资产保全附件"),
    FINANCE(5, "finance", "财务部附件"),
    CAR(6, "car", "车辆附件"),
    OTHER(7, "other", "其他信息附件"),
    VIDEO(8, "video", "视频附件");

    private Integer code;
    private String name;
    private String desc;

    AnnexGroupEnum(Integer code, String name, String desc){
        this.code = code;
        this.name = name;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    public static AnnexGroupEnum getAnnexGroupEnum(Integer legNo) {
        for(AnnexGroupEnum annexGroupEnum : AnnexGroupEnum.values()){
            if(annexGroupEnum.code.equals(legNo)){
                return annexGroupEnum;
            }
        }
        //没有对应的类型，默认用其他类型
        return AnnexGroupEnum.OTHER;
    }


}
